from mcp.server.fastmcp import FastMCP

mcp = FastMCP(name="MCP HTTP Server")


@mcp.tool()
def greet(name: str = "world") -> str:
    return f"hello {name}"


if __name__ == "__main__":
    # 以streamable-http模式运行的服务器，会阻塞运行，监听本机的127.0.0.1:8000 路径为/mcp
    mcp.run(transport="streamable-http")
